package com.huawei.appmarket.service.installdepend.view.activity;

import android.os.Bundle;
import com.huawei.appgallery.foundation.ui.framework.activity.BaseActivity;
import com.huawei.appmarket.service.installdepend.view.activity.protocol.InstallDependActivityProtocol;
import com.huawei.appmarket.service.installdepend.view.fragment.InstallDependFragment;
import com.huawei.appmarket.service.installdepend.view.fragment.protocol.InstallDependFragmentProtocol;
import com.huawei.appmarket.service.installdepend.view.fragment.protocol.InstallDependFragmentProtocol.Request;
import java.io.UnsupportedEncodingException;
import o.cjk;
import o.cjm;
import o.cjo;
import o.Logger;
import o.dnk;
import o.dof;
import o.ear;
import o.ewm.h;
import o.ewm.j;
import o.ewm.n;

public class InstallDependActivity extends BaseActivity<InstallDependActivityProtocol> {
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(h.ᶥॱ);
        if (ᐝ()) {
            ॱ(getString(n.ˋﾟ));
            ॱˊ();
            return;
        }
        finish();
    }

    private boolean ᐝ() {
        InstallDependActivityProtocol installDependActivityProtocol = (InstallDependActivityProtocol) ʾ();
        return (installDependActivityProtocol == null || installDependActivityProtocol.ॱ() == null) ? false : true;
    }

    private void ॱˊ() {
        cjo installDependFragmentProtocol = new InstallDependFragmentProtocol();
        InstallDependActivityProtocol installDependActivityProtocol = (InstallDependActivityProtocol) ʾ();
        if (installDependActivityProtocol != null && installDependActivityProtocol.ॱ() != null) {
            installDependFragmentProtocol.ॱ(ˊ(installDependActivityProtocol.ॱ()));
            ((InstallDependFragment) cjk.ˎ().ˊ(new cjm(installDependActivityProtocol.ˊ(), installDependFragmentProtocol))).ˋ(ˏॱ(), j.ˑʻ, "install.depend.fragment");
        }
    }

    private Request ˊ(InstallDependActivityProtocol.Request request) {
        Request request2 = new Request();
        request2.ˋॱ(request.ˎ());
        request2.ʻॱ(request.ˊ());
        request2.ॱˊ(request.ˋ());
        request2.ॱˎ(request.ˏ());
        request2.ˊ(request.ॱ());
        if (request.ʼ() != null) {
            request2.ˏ(request.ʼ());
        } else if (!dof.ॱ(request.ʽ())) {
            String str;
            String ʽ = request.ʽ();
            try {
                str = new String(dnk.ˎ(ʽ), "UTF-8");
            } catch (UnsupportedEncodingException e) {
                Logger.e("InstallDependActivity", "getInstallDependFgRequest, UnsupportedEncodingException: " + e.toString());
                str = ʽ;
            }
            request2.ˏ(ear.ॱ(str, request.ˊ()));
        }
        return request2;
    }
}
